Skip to content

refactor qwenimage pipeline tests to the new mixin structure#14220

Merged
sayakpaul merged 7 commits into
huggingface:mainfrom
akshan-main:refactor-qwenimage-pipeline-tests
Jul 18, 2026
Merged

refactor qwenimage pipeline tests to the new mixin structure#14220
sayakpaul merged 7 commits into
huggingface:mainfrom
akshan-main:refactor-qwenimage-pipeline-tests

Conversation

@akshan-main

@akshan-main akshan-main commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Refactors the qwenimage pipeline tests to the new mixin structure from #14113: a QwenImagePipelineTesterConfig holding the components and inputs, TestQwenImagePipeline(PipelineTesterMixin) for the fast tests, and TestQwenImagePipelineMemory(MemoryTesterMixin) for the offload and casting tests.

Existing coverage is kept as-is: test_inference and the qwen-specific tests (VAE tiling, true-CFG without a negative mask). No new tests are introduced since the old suite had no caching tests. The attention-slicing test is dropped since the new framework has no equivalent.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline?
  • Did you read our philosophy doc (important for complex PRs)?
  • Was this discussed/approved via a GitHub issue or the forum? Discussed on Slack with @sayakpaul
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

@sayakpaul

@github-actions github-actions Bot added tests size/M PR with diff < 200 LOC labels Jul 18, 2026

@sayakpaul sayakpaul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting started so quickly!


return inputs

def test_inference(self):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep this test perhaps in TestQwenImagePipeline?

Comment on lines +178 to +197
class TestQwenImagePipelineMemory(QwenImagePipelineTesterConfig, MemoryTesterMixin):
pass


class TestQwenImagePipelinePyramidAttentionBroadcast(
QwenImagePipelineTesterConfig, PyramidAttentionBroadcastTesterMixin
):
pass


class TestQwenImagePipelineFirstBlockCache(QwenImagePipelineTesterConfig, FirstBlockCacheTesterMixin):
pass


class TestQwenImagePipelineTaylorSeerCache(QwenImagePipelineTesterConfig, TaylorSeerCacheTesterMixin):
pass


class TestQwenImagePipelineMagCache(QwenImagePipelineTesterConfig, MagCacheTesterMixin):
pass

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the QwenImage test suite didn't have caching tests, let's not introduce them here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed. nothing new added

def test_inference_batch_single_identical(self):
self._test_inference_batch_single_identical(batch_size=3, expected_max_diff=1e-1)

def test_attention_slicing_forward_pass(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test already covered?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's inherited from the base PipelineTesterMixin. The override only loosens the tolerance to 1e-1 (Qwen's batched vs single output exceeds the 1e-4 default, the same value the old test used).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped it. Passes at the base 1e-4 default, so the override wasn't needed.

@akshan-main
akshan-main requested a review from sayakpaul July 18, 2026 05:27
@sayakpaul
sayakpaul merged commit d6064d0 into huggingface:main Jul 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M PR with diff < 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants